﻿<UserControl xmlns:PageBar="clr-namespace:Mengsk.ProxyDelivery.App.UI.PageBar"  x:Class="Mengsk.ProxyDelivery.App.UI.Goods.GoodsCleanUserControl"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
             d:DesignHeight="300" d:DesignWidth="800" Loaded="UserControl_Loaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0" Margin="3" Orientation="Horizontal" VerticalAlignment="Center">
            <TextBlock Text="厂家名称:" Margin="3" VerticalAlignment="Center"/>
            <TextBox Name="tbVendor" Margin="3" VerticalAlignment="Center" Width="100"/>
            <TextBlock Text="货号:" Margin="3" VerticalAlignment="Center"/>
            <TextBox Name="tbNumber" Margin="3" VerticalAlignment="Center" Width="100"/>
            <TextBlock Text="最后出售时间:" Margin="3" VerticalAlignment="Center"/>
            <xctk:DateTimePicker Grid.Row="1" xctk:Format="Custom"  xctk:TimeFormatString="yyyy-MM-dd HH:mm:ss" Grid.Column="5" Name="dpEnd" Margin="3" VerticalAlignment="Center" MinWidth="140"/>
            <Button Name="btnQuery" Margin="3" VerticalAlignment="Center" Content="查询" Width="60" Click="btnQuery_Click"/>
            <Button Name="btnDelete" Margin="3" VerticalAlignment="Center" Content="删除全部" Width="60" Click="btnDelete_Click"/>
            <Button Name="btnDeletePart" Margin="3" VerticalAlignment="Center" Content="删除选中" Width="60" Click="btnDeletePart_Click"/>
        </StackPanel>

        <DataGrid Grid.Row="1" Margin="3" Name="dgvGoods" AutoGenerateColumns="False">
            <DataGrid.Columns>
                <DataGridTextColumn Header="商品编号" Binding="{Binding Source.Id}"/>
                <DataGridTextColumn Header="厂家编号" Binding="{Binding Source.VendorId}"/>
                <DataGridTextColumn Header="货号" Binding="{Binding Source.Number}"/>
                <DataGridTextColumn Header="创建时间" Binding="{Binding Source.CreateTime,Converter={StaticResource datetimeConverter}}"/>
                <DataGridTextColumn Header="更新时间" Binding="{Binding Source.UpdateTime,Converter={StaticResource datetimeConverter}}"/>
                <DataGridTextColumn Header="最后出售时间" Binding="{Binding Source.LastSellTime,Converter={StaticResource datetimeConverter}}"/>
                <DataGridTextColumn Header="处理状态" Binding="{Binding State}"/>
                <DataGridTextColumn Header="URL" Binding="{Binding Source.Url}"/>
            </DataGrid.Columns>
        </DataGrid>
        <PageBar:PageBarUserControl Grid.Row="2" x:Name="pbBar" PageSize="100"  PageChanging="pbBar_PageChanging"/>
    </Grid>
</UserControl>
